Skip to content

Conversation

admin-coderabbit
Copy link
Owner

@admin-coderabbit admin-coderabbit commented Feb 4, 2026

This pull request was automatically created by @coderabbitai/e2e-reviewer.

Batch created pull request.

Summary by CodeRabbit

  • New Features

    • Added Rolling Updates as a preview feature flag requiring explicit enablement for update operations.
  • Documentation

    • Updated operator and server guides with caution notices clarifying that the rolling-updates feature must be enabled during preview.
    • Added configuration examples and exit code documentation for when the feature is disabled.
  • Chores

    • Updated test suite and operator build configurations to support the rolling-updates feature flag.

Closes #36840

Signed-off-by: Pedro Ruivo <pruivo@redhat.com>
@coderabbit-eval
Copy link

coderabbit-eval bot commented Feb 4, 2026

📝 Walkthrough

Walkthrough

The PR introduces a ROLLING_UPDATES feature flag to gate rolling update functionality during its preview phase. Changes span core feature definition, CLI command guards, documentation clarification, exit code management, and test configuration to enforce this preview feature requirement.

Changes

Cohort / File(s) Summary
Core Feature Definition
common/src/main/java/org/keycloak/common/Profile.java
Added new ROLLING_UPDATES enum constant with PREVIEW type to the Feature enum.
Update Compatibility Guards
quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/UpdateCompatibilityCheck.java, quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/UpdateCompatibilityMetadata.java
Added feature-flag guards that check if ROLLING_UPDATES is enabled before proceeding; exits with FEATURE_DISABLED code if disabled.
Error Handling & Exit Codes
quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/AbstractUpdatesCommand.java, quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/compatibility/CompatibilityResult.java
Added printFeatureDisabled() method for feature-disabled messaging; updated exit codes to reassign RECREATE_UPGRADE_EXIT_CODE from 4 to 3 and introduce FEATURE_DISABLED = 4.
Documentation
docs/guides/operator/advanced-configuration.adoc, docs/guides/server/update-compatibility.adoc, docs/guides/templates/kc.adoc
Added CAUTION blocks and feature-enabling guidance; updated command examples to include --features=rolling-updates flag; added exit code documentation for feature-disabled state.
Build & Test Updates
operator/scripts/Dockerfile-custom-image, operator/src/test/java/org/keycloak/operator/testsuite/integration/UpgradeTest.java
Added --features=rolling-updates flag to build command; updated test initialization to use FeatureSpec instead of UnsupportedSpec for enabling rolling updates.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 A rolling update hops with grace,
Gated by a feature flag in place,
Through CLI commands, guards take their stand,
While tests and docs lend a helping hand,
Preview mode blooms, controlled and fair,
Like carrots arranged with utmost care! 🥕

🚥 Pre-merge checks | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Description check ⚠️ Warning The description is minimal and indicates this is an auto-generated PR, but it lacks substantive detail about the actual changes, objectives, or implementation details required by the contributing guidelines. Provide a detailed description explaining what the rolling-updates feature does, why these changes are needed, and how they affect the operator and CLI commands.
Title check ❓ Inconclusive The title 'Automated Test: feature-rolling-updates-implementation' is vague and generic, using a template-like format that doesn't clearly describe the main changes in the changeset. Revise the title to describe the primary change, such as 'Add rolling-updates feature flag and enforce it in update commands' or similar.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature-rolling-updates-implementation

Comment @coderabbit eval help to get the list of available commands and usage tips.

@coderabbit-eval coderabbit-eval bot closed this Feb 4, 2026
Copy link

@coderabbit-eval coderabbit-eval bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
operator/src/test/java/org/keycloak/operator/testsuite/integration/UpgradeTest.java (1)

102-117: ⚠️ Potential issue | 🔴 Critical

ROLLING_UPDATES feature is not enabled when updateStrategy is null, but rolling upgrade behavior is still expected.

When updateStrategy is null, the method returns at Line 106 without enabling the ROLLING_UPDATES feature. However, testCacheMaxCount(null) expects eventuallyRollingUpgradeStatus() (line 94-95) for non-RECREATE strategies.

The update-compatibility CLI commands check Profile.isFeatureEnabled(Profile.Feature.ROLLING_UPDATES) and exit with code 4 (FEATURE_DISABLED) if the feature is disabled. If the operator or any downstream reconciliation path invokes these commands, the test will fail when updateStrategy is null despite expecting rolling upgrade behavior.

🤖 Fix all issues with AI agents
In `@docs/guides/operator/advanced-configuration.adoc`:
- Around line 446-450: Update the CAUTION block in advanced-configuration.adoc
to use consistent grammar: replace the phrase "While on preview stage, the
feature `rolling-updates` must be enabled." with "While in the preview stage,
the feature `rolling-updates` must be enabled." so it matches the wording used
in update-compatibility.adoc; locate the CAUTION block containing
`rolling-updates` and update that sentence only.

In `@docs/guides/server/update-compatibility.adoc`:
- Around line 12-16: Update the sentence in the docs that reads "While on
preview stage, the feature `rolling-updates` must be enabled." to use correct
grammar: change "While on preview stage" to "While in the preview stage" so the
full sentence becomes "While in the preview stage, the feature `rolling-updates`
must be enabled." Reference the exact phrase "While on preview stage" in the
file and replace it accordingly.
🧹 Nitpick comments (2)
docs/guides/templates/kc.adoc (1)

50-55: Hardcoded --features=rolling-updates will need removal when the feature graduates from preview.

This is a reasonable approach for the preview phase. Just be aware that when ROLLING_UPDATES moves to Type.DEFAULT, this template addition should be reverted to avoid showing an unnecessary flag in all documentation examples.

quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/UpdateCompatibilityMetadata.java (1)

46-50: Consider extracting the feature-flag guard into AbstractUpdatesCommand.

This guard block is identical to the one in UpdateCompatibilityCheck.run(). You could use a template method in the base class to avoid duplicating this check in every subcommand:

// In AbstractUpdatesCommand
`@Override`
public final void run() {
    if (!Profile.isFeatureEnabled(Profile.Feature.ROLLING_UPDATES)) {
        printFeatureDisabled();
        picocli.exit(CompatibilityResult.FEATURE_DISABLED);
        return;
    }
    printPreviewWarning();
    doRun();
}

protected abstract void doRun();

That said, with only two subcommands this is minor and the current explicit approach is fine.

Comment on lines +446 to +450
[CAUTION]
====
While on preview stage, the feature `rolling-updates` must be enabled.
Otherwise, the {project_name} Operator will fail.
====

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Same grammar nit: "While on preview stage" → "While in the preview stage".

For consistency with the fix suggested in update-compatibility.adoc.

Proposed fix
 [CAUTION]
 ====
-While on preview stage, the feature `rolling-updates` must be enabled.
+While in the preview stage, the feature `rolling-updates` must be enabled.
 Otherwise, the {project_name} Operator will fail.
 ====
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
[CAUTION]
====
While on preview stage, the feature `rolling-updates` must be enabled.
Otherwise, the {project_name} Operator will fail.
====
[CAUTION]
====
While in the preview stage, the feature `rolling-updates` must be enabled.
Otherwise, the {project_name} Operator will fail.
====
🤖 Prompt for AI Agents
In `@docs/guides/operator/advanced-configuration.adoc` around lines 446 - 450,
Update the CAUTION block in advanced-configuration.adoc to use consistent
grammar: replace the phrase "While on preview stage, the feature
`rolling-updates` must be enabled." with "While in the preview stage, the
feature `rolling-updates` must be enabled." so it matches the wording used in
update-compatibility.adoc; locate the CAUTION block containing `rolling-updates`
and update that sentence only.

Comment on lines +12 to +16
[CAUTION]
====
While on preview stage, the feature `rolling-updates` must be enabled.
Otherwise, the commands will fail.
====

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Minor grammar nit: "While on preview stage" → "While in the preview stage".

Proposed fix
 [CAUTION]
 ====
-While on preview stage, the feature `rolling-updates` must be enabled.
+While in the preview stage, the feature `rolling-updates` must be enabled.
 Otherwise, the commands will fail.
 ====
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
[CAUTION]
====
While on preview stage, the feature `rolling-updates` must be enabled.
Otherwise, the commands will fail.
====
[CAUTION]
====
While in the preview stage, the feature `rolling-updates` must be enabled.
Otherwise, the commands will fail.
====
🤖 Prompt for AI Agents
In `@docs/guides/server/update-compatibility.adoc` around lines 12 - 16, Update
the sentence in the docs that reads "While on preview stage, the feature
`rolling-updates` must be enabled." to use correct grammar: change "While on
preview stage" to "While in the preview stage" so the full sentence becomes
"While in the preview stage, the feature `rolling-updates` must be enabled."
Reference the exact phrase "While on preview stage" in the file and replace it
accordingly.

Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant